/**
 * 数据字典表格列
 */
import { ref } from 'vue'
import { TableColumnProps } from '../../../components/base/table/table-props'
import { Dict } from '@/entity/system/dict'
// @ts-ignore
export const columns: Array<TableColumnProps<Dict>> = [
  {
    title: '编号',
    // @ts-ignore
    customRender: ({ index }) => index + 1,
    width: 60,
    align: 'center',
  },
  {
    title: '标签名',
    width: 150,
    dataIndex: 'label',
  },
  {
    title: '描述',
    width: 200,
    dataIndex: 'description',
  },
  {
    title: '排序（升序） ',
    dataIndex: 'sort',
    width: 170,
  },
  {
    title: '类型',
    width: 200,
    dataIndex: 'type',
  },
  {
    title: '数据值',
    width: 250,
    dataIndex: 'value',
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    customRender: ({ record }) => (record.createTime ? record.createTime.replace('T', ' ') : ''),
    width: 200,
  },
  {
    title: '修改时间',
    dataIndex: 'lastUpdateTime',
    customRender: ({ record }) => (record.lastUpdateTime ? record.lastUpdateTime.replace('T', ' ') : ''),
    width: 200,
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: 200,
    align: 'center',
    fixed: 'right',
  },
]
